﻿CREATE TABLE [dbo].[Files] (
    [Id]              VARCHAR (50)               NOT NULL,
    [OwnerId]         INT                        NULL,
    [FileName]        NVARCHAR (256)             NOT NULL,
    [Content]         VARBINARY (MAX) FILESTREAM NULL,
    [ContentEncoding] VARCHAR (50)               NULL,
    [ContentType]     VARCHAR (50)               NOT NULL,
    [FileRowguid]     UNIQUEIDENTIFIER           DEFAULT (newsequentialid()) ROWGUIDCOL NOT NULL,
    [LastModified]    DATETIME                   DEFAULT (getdate()) NOT NULL,
    UNIQUE NONCLUSTERED ([FileRowguid] ASC)
) FILESTREAM_ON [MyFilesStream];

